package com.matchmaking.system.service.Impl;

import com.matchmaking.system.domain.Bing;
import com.matchmaking.system.domain.SysRole;
import com.matchmaking.system.domain.SysRoleMenu;
import com.matchmaking.system.domain.ZhuZhuang;
import com.matchmaking.system.mapper.SysRoleMapper;
import com.matchmaking.system.mapper.SysRoleMenuMapper;
import com.matchmaking.system.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysRoleServiceImpl implements SysRoleService {
    @Autowired
    SysRoleMapper sysRoleMapper;
    @Autowired
    SysRoleMenuMapper sysRoleMenuMapper;
    @Override
    public List<SysRole> selectAll() {
        return sysRoleMapper.selectAll();
    }

    @Override
    public int deleteObjectById(String roleId) {
        return sysRoleMapper.deleteObjectById(roleId);
    }

    @Override
    public List<SysRole> selectObject(SysRole role) {
        return sysRoleMapper.selectObjects(role);
    }

    @Override
    public boolean insertObject(SysRole sysRole) {
        return sysRoleMapper.insertObject(sysRole);
    }

    @Override
    public void updateStatus(SysRole sysRole) {
        sysRoleMapper.updStatus(sysRole);
    }

    @Override
    public boolean updateObject(SysRole sysRole) {
        return sysRoleMapper.updateObject(sysRole);
    }

    @Override
    public void saveRoleMenu(SysRoleMenu sysRoleMenu) {
        sysRoleMenuMapper.saveRoleMenu(sysRoleMenu);
    }

    @Override
    public List<Bing> statusTable() {
        return sysRoleMapper.statusTable();
    }

    @Override
    public List<ZhuZhuang> scopeTable() {
        return sysRoleMapper.scopeTable();
    }

    @Override
    public List<SysRole> selectObjectsByUserId(Long userId) {
        return sysRoleMapper.selectObjectsByUserId(userId);
    }
}
